#include "lib.h"

#include "bjserv.h"
#include "bjconn.h"

#include "casbase.h"

#include "bjrules.h"

BJServer::BJServer(int port)
	: Server(port,TEXT("BlackJack"))
{
	startTracker();
}

BJServer::~BJServer()
{
	//bj rulesets are static and shared between connections
	//if they are still allocated delete them now!

	for(uint8 i=0;i<100;i++)
	{
		BJRules* pRules = BJRules::GetRuleSet( i );
		delete pRules;
		pRules = 0;
	}

	stopTracker();
}

Connection*
BJServer::createConnection(SOCKET client)
{
	return new BJConnection(this, client);
}

